﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NDatabase.Repository.Json;
using NDatabase.Repository.Test.Models;

namespace NDatabase.Repository.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            var context = new TestDbContext();

            var user = context.User.AsQueryable().FirstOrDefault(x => x.Name == "alien");
            Print(context.User.Count());
            var u = new User
            {
                Name = "alien",
                Age = 18
            };
            try
            {
                context.User.Save(u);
            }
            catch (Exception)
            {
                throw;
            }
            
            context.SaveChanges();

            Print(context.User.Count());

            Console.Read();
        }

        static void Print(object obj)
        {
            Console.WriteLine(obj);
        }
    }
}
